import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'

//导入布局组件
import Layout from '../views//layout/Layout.vue'



Vue.use(VueRouter)


const routes: Array<RouteConfig> = [
  //后台首页
  {
    path: '/',
    name: 'home',
    component: Layout,
    redirect:'/home',
    children:[
      {
        path:'/home',
        component:()=>import('../views/home/Home.vue'),
      }
    ]
  },
  {
    path:'/detail',
    name:'detail',
    component:()=>import('../views/detail/Detail.vue')//大页面不用写儿子
  }

]

const router = new VueRouter({
  routes
})

export default router
